<%= form_for(@page) do |f| %>
  <% if @page.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@page.errors.count, "error") %> prohibited this page from being saved:</h2>

      <ul>
      <% @page.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :title %><br>
    <%= f.text_field :title %>
  </div>
  <div class="field">
    <%= f.label :show_title %><br>
    <%= f.check_box :show_title %>
  </div>
  <div class="field">
    <%= f.label :featured %><br>
    <%= f.check_box :featured %>
  </div>
  <div class="field">
    <%= f.label :category_id %><br>
    <%= f.select :category_id,options_from_collection_for_select(@categories,:id,:name,f.object.category_id)  %>
  </div>
  <div class="field">
    <%= f.label :text %><br>
    <%= f.text_area :text, :class => "tinymce", :rows => 20, :cols => 80 %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
